package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.TenantUsersMapper;
import com.hgkj.cloud.base.domain.TenantUsers;
import com.hgkj.cloud.base.service.TenantUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TenantUsersServiceImpl implements TenantUsersService {

    @Autowired
    private TenantUsersMapper tenantUsersMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return tenantUsersMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(TenantUsers record) {
        return tenantUsersMapper.insert(record);
    }

    @Override
    public int insertSelective(TenantUsers record) {
        return tenantUsersMapper.insertSelective(record);
    }

    @Override
    public TenantUsers selectByPrimaryKey(Long id) {
        return tenantUsersMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(TenantUsers record) {
        return tenantUsersMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(TenantUsers record) {
        return tenantUsersMapper.updateByPrimaryKey(record);
    }

    @Override
    public TenantUsers getUserInfo(Map<String, Object> map) {
        return tenantUsersMapper.getUserInfo(map);
    }

    @Override
    public List<TenantUsers> listUsers(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantUsersMapper.listUsers(map);
    }

    @Override
    public Long listUsersCount(Map<String, Object> map) {
        return tenantUsersMapper.listUsersCount(map);
    }

    @Override
    public int updateUserType(Map<String, Object> map) {
        return tenantUsersMapper.updateUserType(map);
    }

    @Override
    public List<TenantUsers> listQnTaskUsers(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantUsersMapper.listQnTaskUsers(map);
    }

    @Override
    public long listQnTaskUsersCount(Map<String, Object> map) {
        return tenantUsersMapper.listQnTaskUsersCount(map);
    }

    @Override
    public List<TenantUsers> listTableTaskUsers(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return tenantUsersMapper.listTableTaskUsers(map);
    }

    @Override
    public long listTableTaskUsersCount(Map<String, Object> map) {
        return tenantUsersMapper.listTableTaskUsersCount(map);
    }

    @Override
    public List<Long> getAllUserInfo() {
        return tenantUsersMapper.getAllUserInfo();
    }

    @Override
    public TenantUsers getUserById(String userId) {
        return tenantUsersMapper.getUserById(userId);
    }

    @Override
    public int deleteUserCreateDate() {
        return tenantUsersMapper.deleteUserCreateDate();
    }

    @Override
    public Map getUserIntegral(String userUuid) {
        return tenantUsersMapper.getUserIntegral(userUuid);
    }
}
